<<<<<<< HEAD
<?php 
header("Content-Type: text/html;charset=utf-8");
include_once 'includes/res.php';
include_once 'includes/header.php';
require_once 'service/UserService.php';

if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'login') {
    $email = $_REQUEST['email'];
    $password = $_REQUEST['password'];
    $userService = new UserService();
    $flag = $userService->auth($email, $password);
    if ($flag) {
        if (!empty($_REQUEST['from'])) {
            echo $_REQUEST['from'];
            header("location:".$_REQUEST['from']);
        } else {
            header("location:/".APP_CONTEXT);
        }
    } else {
        echo "error";
    }
}
?>
<div class="container">
    <div class="row">
    <div class="span9">
        <form class="well form-inline" method="post">
            <input type="hidden" name="action" value="login">
            <input type="text" name="email" placeholder="Email">
            <input type="password" name="password" placeholder="Password">
            <!--  
            <label class="checkbox">
              <input type="checkbox">Remember me
            </label>
            -->
            <button type="submit" class="btn btn-primary">登录</button>
        </form>
    </div>
  </div>
</div>
<?php 
include_once './includes/footer.php';
=======
<?php 
header("Content-Type: text/html;charset=utf-8");
include_once 'includes/res.php';
include_once 'includes/header.php';
require_once 'service/UserService.php';

if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'login') {
    $email = $_REQUEST['email'];
    $password = $_REQUEST['password'];
    $userService = new UserService();
    $flag = $userService->auth($email, $password);
    if ($flag) {
        if (!empty($_REQUEST['from'])) {
            echo $_REQUEST['from'];
            header("location:".$_REQUEST['from']);
        } else {
            header("location:/".APP_CONTEXT);
        }
    } else {
        echo "error";
    }
}
?>
<div class="container">
    <div class="row">
    <div class="span9">
        <form class="well form-inline" method="post">
            <input type="hidden" name="action" value="login">
            <input type="text" name="email" placeholder="Email">
            <input type="password" name="password" placeholder="Password">
            <!--  
            <label class="checkbox">
              <input type="checkbox">Remember me
            </label>
            -->
            <button type="submit" class="btn btn-primary">登录</button>
        </form>
    </div>
  </div>
</div>
<?php 
include_once './includes/footer.php';
>>>>>>> 20d6c557d209a3f376420616f57b4bd953611975
?>